this._apRemovedId = 0;
}
+ if (this._strengthChangedId) {
+ this._activeAccessPoint.disconnect(this._strengthChangedId);
+ this._strengthChangedId = 0;
+ }
+
this.parent();
},
},
_activeApChanged: function() {
- this._activeNetwork = null;
+ let ap = this._device.active_access_point;
+ if (this._activeAccessPoint == ap)
+ return;
- let activeAp = this._device.active_access_point;
+ if (this._activeAccessPoint) {
+ this._activeAccessPoint.disconnect(this._strengthChangedId);
+ this._strengthChangedId = 0;
+ }
- if (activeAp) {
- let res = this._findExistingNetwork(activeAp);
+ this._activeAccessPoint = ap;
+
+ if (this._activeAccessPoint) {
+ this._strengthChangedId = this._activeAccessPoint.connect('notify::strength',
+ Lang.bind(this, this._strengthChanged));
+ let res = this._findExistingNetwork(activeAp);
if (res != null)
this._activeNetwork = this._networks[res.network];
}
- // we don't refresh the view here, _activeConnectionChanged will
+ this.emit('icon-changed');
+ },
+
+ _strengthChanged: function() {
+ this.emit('icon-changed');
},
_getApSecurityType: function(accessPoint) {
}
},
- _updateAccessPoint: function() {
- let ap = this._device.active_access_point;
- if (this._activeAccessPoint == ap)
- return;
-
- if (this._activeAccessPoint) {
- this._activeAccessPoint.disconnect(this._strengthChangedId);
- this._strengthChangedId = 0;
- }
-
- this._activeAccessPoint = ap;
-
- if (this._activeAccessPoint) {
- this._strengthChangedId = this._activeAccessPoint.connect('notify::strength',
- Lang.bind(this, this._strengthChanged));
- }
-
- this._syncStatusLabel();
- },
-
- _strengthChanged: function() {
- this.emit('icon-changed');
- },
-
getIndicatorIcon: function() {
if (this._device.active_connection.state == NetworkManager.ActiveConnectionState.ACTIVATING)
return 'network-wireless-acquiring-symbolic';